home *** CD-ROM | disk | FTP | other *** search
/ Erotic Games: Memory / Erotic Games: Memory.iso / mac / air_installers / AdobeAIR.exe / setup.swf / scripts / mx / core / TextFieldFactory.as < prev    next >
Text File  |  2009-02-12  |  2KB  |  68 lines

  1. package mx.core
  2. {
  3.    import flash.text.TextField;
  4.    import flash.utils.Dictionary;
  5.    
  6.    use namespace mx_internal;
  7.    
  8.    public class TextFieldFactory implements ITextFieldFactory
  9.    {
  10.       
  11.       mx_internal static const VERSION:String = "3.0.0.0";
  12.       
  13.       private static var instance:ITextFieldFactory;
  14.        
  15.       
  16.       private var textFields:Dictionary;
  17.       
  18.       public function TextFieldFactory()
  19.       {
  20.          textFields = new Dictionary(true);
  21.          super();
  22.       }
  23.       
  24.       public static function getInstance() : ITextFieldFactory
  25.       {
  26.          if(!instance)
  27.          {
  28.             instance = new TextFieldFactory();
  29.          }
  30.          return instance;
  31.       }
  32.       
  33.       public function createTextField(param1:IFlexModuleFactory) : TextField
  34.       {
  35.          var _loc4_:* = null;
  36.          var _loc2_:TextField = null;
  37.          var _loc3_:Dictionary = textFields[param1];
  38.          if(_loc3_)
  39.          {
  40.             var _loc5_:int = 0;
  41.             var _loc6_:* = _loc3_;
  42.             for(_loc4_ in _loc6_)
  43.             {
  44.                _loc2_ = TextField(_loc4_);
  45.             }
  46.          }
  47.          if(!_loc2_)
  48.          {
  49.             if(param1)
  50.             {
  51.                _loc2_ = TextField(param1.create("flash.text.TextField"));
  52.             }
  53.             else
  54.             {
  55.                _loc2_ = new TextField();
  56.             }
  57.             if(!_loc3_)
  58.             {
  59.                _loc3_ = new Dictionary(true);
  60.             }
  61.             _loc3_[_loc2_] = 1;
  62.             textFields[param1] = _loc3_;
  63.          }
  64.          return _loc2_;
  65.       }
  66.    }
  67. }
  68.